package com.ruoyi.business.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.ClassInfoMapper;
import com.ruoyi.business.domain.ClassInfo;
import com.ruoyi.business.service.IClassInfoService;

/**
 * 班级Service业务层处理
 * 
 * @author lcz
 * @date 2025-02-20
 */
@Service
public class ClassInfoServiceImpl implements IClassInfoService 
{
    @Autowired
    private ClassInfoMapper classInfoMapper;

    /**
     * 查询班级
     * 
     * @param id 班级主键
     * @return 班级
     */
    @Override
    public ClassInfo selectClassInfoById(Long id)
    {
        return classInfoMapper.selectClassInfoById(id);
    }

    /**
     * 查询班级列表
     * 
     * @param classInfo 班级
     * @return 班级
     */
    @Override
    public List<ClassInfo> selectClassInfoList(ClassInfo classInfo)
    {
        return classInfoMapper.selectClassInfoList(classInfo);
    }

    /**
     * 新增班级
     * 
     * @param classInfo 班级
     * @return 结果
     */
    @Override
    public int insertClassInfo(ClassInfo classInfo)
    {
        classInfo.setCreateTime(DateUtils.getNowDate());
        return classInfoMapper.insertClassInfo(classInfo);
    }

    /**
     * 修改班级
     * 
     * @param classInfo 班级
     * @return 结果
     */
    @Override
    public int updateClassInfo(ClassInfo classInfo)
    {
        classInfo.setUpdateTime(DateUtils.getNowDate());
        return classInfoMapper.updateClassInfo(classInfo);
    }

    /**
     * 批量删除班级
     * 
     * @param ids 需要删除的班级主键
     * @return 结果
     */
    @Override
    public int deleteClassInfoByIds(Long[] ids)
    {
        return classInfoMapper.deleteClassInfoByIds(ids);
    }

    /**
     * 删除班级信息
     * 
     * @param id 班级主键
     * @return 结果
     */
    @Override
    public int deleteClassInfoById(Long id)
    {
        return classInfoMapper.deleteClassInfoById(id);
    }
}
